package com.cq.hd.member.api;

import com.cq.hd.common.pagination.Page;
import com.cq.hd.common.response.Result;
import com.cq.hd.member.api.dto.*;
import com.cq.hd.member.api.vo.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "hd-o2o-member-service", contextId = "merchant-api")
public interface TbMerchantApi {

    // 列表
    @GetMapping("/member/merchant/pageMerchant")
    Result<Page<MerchantPageVo>> pageMerchant(@SpringQueryMap MerchantPageDto merchantPageDto);

    // 详情
    @GetMapping("/member/merchant/details")
    Result<AdminMerchantPageVo> details(@RequestParam("id") Long id);

    // 关联商家列表
    @GetMapping("/member/merchant/pageRelationBusiness")
    Result<Page<RelationBusinessPageVo>> pageRelationBusiness(@SpringQueryMap RelationBusinessPageDto relationBusinessPageDto);

    // 根据手机号获取商户信息
    @GetMapping("/member/merchant/getByMobile")
    Result<MerchantVo> getByMobile(@RequestParam("mobile") String mobile);

    // 根据用户id获取商户信息
    @GetMapping("/member/merchant/getById")
    Result<MerchantVo> getById(@RequestParam("id") long id);

    // 更新商户数据
    @PostMapping("/member/merchant/updateMerchant")
    Result<Boolean> updateMerchant(@RequestBody MerchantUpdateDto merchantUpdateDto);

    // app商户列表
    @GetMapping("/member/merchant/pageAppMerchant")
    Result<Page<AppMerchantPageVo>> pageAppMerchant(@SpringQueryMap AppMerchantPageDto appMerchantPageDto);

    // 商户详情
    @GetMapping("/member/merchant/detailAppMerchant")
    Result<AppMerchantDetailVo> detailAppMerchant(@SpringQueryMap AppMerchantDetailDto appMerchantDetailDto);

    // 根据商户id批量获取商户数据
    @PostMapping("/member/merchant/listByIds")
    Result<List<MerchantPageVo>> listByIds(@RequestBody List<String> ids);

    // 根据openId获取商户数据
    @GetMapping("/member/merchant/getByOpenId")
    Result<MerchantVo> getByOpenId(@RequestParam("openid") String openid);

    // 更新客服信息
    @PostMapping("/member/merchant/updateCustomInfo")
    Result<Boolean> updateCustomInfo(@RequestBody MerchantCustomUpdateDto merchantCustomUpdateDto);

    // 修改登录密码
    @PostMapping("/member/merchant/updatePwd")
    Result<Boolean> updatePwd(@RequestBody MerchantPwdUpdateDto merchantPwdUpdateDto);

    // 根据日期查询新入驻的商户数
    @GetMapping("/member/merchant/getNewCountByDate")
    Result<Integer> getNewCountByDate(@RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime);

    // 批量获取商户详情数据
    @PostMapping("/member/merchant/listDetailByIds")
    Result<List<MerchantDetailVo>> listDetailByIds(@RequestBody List<Long> merchantIds);

    // 增加商户的商户本金和商户补贴金额
    @PostMapping("/member/merchant/addMerchantAmt")
    Result<Boolean> addMerchantAmt(@RequestBody MerchantAmtAddDto merchantAmtAddDto);

    @PostMapping("/member/merchant/updateBankCard")
    Result<Boolean> updateBankCard(@RequestBody MerchantBankCardDto merchantBankCardDto);

    @GetMapping("/member/merchant/getBankCard")
    Result<MerchantBankCardVo> getBankCard(@RequestParam("merchantId") Long merchantId);

}
